<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

/**
 * $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework');
 */
 
$cakeDescription = __d('cake_dev', 'Polaron: European Solutions');
$loggedUser = $this->Session->read('Auth.User');
?>
<!DOCTYPE html>
<html>
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php echo $cakeDescription ?>:
		<?php echo $title_for_layout; ?>
	</title>
	<div id="header">
        	<?php
				/** echo $this->Html->image('polaronLogo.png', array('alt'=> 'Polaron Logo', true)); */
				echo $this->Html->image('polaronLogo.png', array("alt" => "Home", 'url' => array ('controller' => 'Pages', 'action' => 'display', 'home')));
			?>
        </div>
	<?php
		echo $this->Html->meta('icon');
		/** echo $this->Html->css('bootstrap'); */
		echo $this->Html->css('default');
		/** echo $this->Html->css('cake.generic'); */

		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
		?>
			
				<div id="navigation">
					<!-- <ul  class="nav nav-tabs"> -->
					<ul>
					<?php
					if(!empty($loggedUser) && $loggedUser['role']!=9)
					{
						?>
						<li><?php echo $this->Html->link('Home', '/'); ?> </li>
						<li><?php echo $this->Html->link('Users List', array('controller'=>'Users', 'action'=>'index'));?> </li>
						<li><?php echo $this->Html->link(__('My Account'), array('controller' => 'users', 'action' => 'myaccount')); ?></li>
						<li><?php echo $this->Html->link('Documents', array('controller'=>'Documents', 'action'=>'index'));?> </li>
						<li><?php echo $this->Html->link('Paper Files', array('controller'=>'Paperfiles', 'action'=>'index'));?> </li>
						<li><?php echo $this->Html->link('Archive Names', array('controller'=>'Archivenames', 'action'=>'index'));?> </li>	
						<li><?php echo $this->Html->link('Enquiries', array('controller'=>'Enquiries', 'action'=>'index'));?> </li>
					<?php
					}
					else if(!empty($loggedUser) && $loggedUser['role']==9)
					{
					?>
					<li><?php echo $this->Html->link('My Account', array('controller'=>'Users', 'action'=>'myaccount'));?> </li>
					<li><?php echo $this->Html->link('My Enquiry', array('controller'=>'Enquiries', 'action'=>'myenquiry'));?> </li>
					<?php
					}
					else
					{
					?>
						<li><?php echo $this->Html->link('Login', '../users/login'); ?> </li>
						<li><?php echo $this->Html->link('Register', '../users/signup'); ?> </li>
					<?php
					}
					if(!empty($loggedUser))
					{
					?>
						<li><?php echo $loggedUser['first_name'],' ',$loggedUser['surname']; ?> </li>
						<li><?php echo $this->Html->link('Log Out', '../users/logout'); ?> </li>
					<?php
					}
					?>
					</ul>
				</div> 
</head>
<body>
    
	<div id="container">
    	
        <!-- <div id="loginReg">
        	<ul>
            	
            </ul>
		</div> -->
        
    	
        
        <!-- <div id="navigation"> -->
            <!-- <ul  class="nav nav-tabs"> -->
            <!-- <ul>
                <li><?php /** echo $this->Html->link('Home', 'http://ie.infotech.monash.edu.au/team16/Development/'); ?> </li>
                <li><?php echo $this->Html->link('Documents', array('controller'=>'Documents', 'action'=>'index'));?> </li>
                <li><?php echo $this->Html->link('Users', array('controller'=>'Users', 'action'=>'index'));?> </li>
                <li><?php echo $this->Html->link('Login', 'http://ie.infotech.monash.edu.au/team16/Development/users/login'); ?> </li>
            	<li><?php echo $this->Html->link('Register', 'http://ie.infotech.monash.edu.au/team16/Development/users/signup'); */ ?> </li>
            </ul>
    	</div> -->
        
		<div id="content">

			<?php echo $this->Session->flash(); ?>

			<?php echo $this->fetch('content'); ?>
		</div>
        
        <div id="footer">
        	<p>Copyright &copy; 2013 <a href="http://ie.infotech.monash.edu.au/team16/Development/">Polaron</a>. All Rights Reserved<br/>
            FIT3047 - Industrial Experience<br/>
            Team 16 - TheOz</p>
        </div>
	</div>
	<?php /** echo $this->element('sql_dump'); */ ?>
</body>
</html>
